package com.jjty.dataGenerator.sxhcampus.vo;

import com.jjty.dataGenerator.sxhcampus.utils.AgentIdMap;
import lombok.Data;

import java.io.Serializable;

@Data
public class OAOrderData implements Serializable {

    /**
     * 晒单人
     */
    private String user_name;

    /**
     * 办理号码
     */
    private String order_phone;


    /**
     * 家长，孩子
     */
    private String remark;

    /**
     * 城市
     */
    private String city;

    /**
     * 区县
     */
    private String district;

    /**
     * 设备号
     */
    private String device;

    private String parentName;

    private String childName;

    public void setRemark(String remark) {
        if(remark != null && !remark.isEmpty()){
            String[] split = remark.split("，");
            if(split.length > 1){
                parentName = split[0];
                childName = split[1];
            }else{
                parentName = split[0];
                childName = split[0];
            }
        }
    }

    public ActiveImportData getImportData(Integer logId) {
        ActiveImportData data = new ActiveImportData();
        data.setLogId(logId);
        //咸阳：快上云：508402   其他：烽火万家：508393
//        data.setAgentId(city.equals("咸阳市")?"508402":"508393");
        data.setAgentId(AgentIdMap.getAgentIdByCityName(city));
        data.setCity(this.getCity());
        data.setArea(this.getDistrict());
        data.setHzName(this.getChildName());
        data.setKhName(this.getParentName());
        data.setSdName(this.getUser_name());
        data.setImei(this.getDevice());
        data.setPhone(this.getOrder_phone());
        return data;
    }

    /**
     * 业务员
     */
    //private String counterpart;

}
